#include <bits/stdc++.h>
using namespace std;
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
using ll = long long;
ll n, s;
const ll N = 1e5 + 10;
struct pp
{
    ll p, c;
} a[N];
bool cmp(pp a, pp b)
{
    if (a.c == b.c)
        return a.p < b.p;
    return a.c < b.c;
}
void solve()
{
    cin >> n >> s;
    ll sum_toge = 0;
    for (ll i = 1; i <= n; i++)
    {
        cin >> a[i].p >> a[i].c;
        sum_toge += a[i].p;
    }
    sort(a + 1, a + n + 1, cmp);
    ll ans = 0;
    ll jsq = 1;
    ll time = 0;
    // cout << sum_toge << endl;
    while (sum_toge >= s)
    {
        
        ans += s * (a[jsq].c-time);
        time += a[jsq].c-time;
        // jsq++;
        sum_toge -= a[jsq].p;
        jsq++;
        if (jsq > n)
            break;
        // cout << sum_toge << endl;
    }
    // cout << ans << endl;
    // cout << a[jsq].p << ":" << a[jsq].c << endl;
    // cout << jsq << endl;
    for (ll i = jsq; i <= n; i++)
    {
        ans += a[i].p * (a[i].c - time);
    }

    cout << ans << endl;
}

int main()
{
    int t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
